<%-- 
    Document   : mushroomlist
    Created on : 22.12.2012, 18:19:31
    Author     : Lukas Marica
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>

<s:useActionBean beanclass="cz.muni.fi.pa165.portalnahoubyclient.MushroomsActionBean" var="actionBean"/>

<table class="listtable">
	<tr>
		<th width="50%"><f:message key="mushroom.name"/></th>
<th width="12%"><f:message key="mushroom.edibility"/></th>
<th width="12%"><f:message key="mushroom.growFrom"/></th>
<th width="12%"><f:message key="mushroom.growTo"/></th>
<th width="5%"></th>
<th width="5%"></th>
</tr>
<c:forEach items="${actionBean.mushrooms}" var="mushroom" varStatus="status">
	<tr class="${(status.count % 2 == 0 ) ? "even" : "odd"}">
		<td><c:out value="${mushroom.name}"/></td>
	<td><f:message key="Edibility.${mushroom.edibility}"/></td>
	<td><f:message key="Month.${mushroom.growFrom}"/></td>
	<td><f:message key="Month.${mushroom.growTo}"/></td>
	<td><s:link beanclass="cz.muni.fi.pa165.portalnahoubyclient.MushroomsActionBean" event="edit"><s:param name="mushroom.id" value="${mushroom.id}"/><f:message key="edit"/></s:link> </td>
	<td><s:link addSourcePage="true" beanclass="cz.muni.fi.pa165.portalnahoubyclient.MushroomsActionBean" event="delete" class="deleteentity" title="${mushroom.name}"><s:param name="mushroom.id" value="${mushroom.id}"/><f:message key="delete"/></s:link> </td>
	</tr>
</c:forEach>
</table>

<s:form beanclass="cz.muni.fi.pa165.portalnahoubyclient.MushroomsActionBean">
	<fieldset><legend><f:message key="mushroom.new"/></legend>
		<%@include file="mushroomform.jsp"%>
		<s:submit name="add"><f:message key="create"/></s:submit>
	</fieldset>
</s:form>